<?php

class historia extends object_standard {

    //attributes
    protected $id;
    protected $titulo;
    protected $argumento;
    protected $guion;
    protected $escritor;
    protected $videojuego;

    //components
    var $components = array();
    //auxiliars for primary key and for files
    var $auxiliars = array();

    //data about the attributes
    public function metadata() {
        return array("id" => array(), "titulo" => array(), "argumento" => array(), "guion" => array(),
            "escritor" => array("foreign_name" => "e_h", "foreign" => "empleado", "foreign_attribute" => "cedula"),
            "videojuego" => array("foreign_name" => "v_h", "foreign" => "videojuego", "foreign_attribute" => "id"));
    }

    public function primary_key() {
        return array("id");
    }

    public function relational_keys($class, $rel_name) {
        switch ($class) {
            case "empleado":
                switch ($rel_name){
                    case "e_h":
                        return array("escritor");
                    break;
                }
            break;
            
            case "videojuego":
                switch ($rel_name){
                    case "v_h":
                        return array("videojuego");
                    break;                   
                }
            break;
            default:
                break;
        }
    }
   
}

?>